package Models;

import DB.DBCar;
import DB.DBGuard;
import DB.RowAbstract;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
// #[regen=yes,id=DCE.4EC845D9-5255-C179-3C93-417EC83DBA7B]
// </editor-fold> 
public class Schedule extends RowAbstract
{
	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,id=DCE.6718C96B-E295-A5C5-5932-4A204BD3E93C]
	// </editor-fold>
	private Guard guard;

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,id=DCE.1A41F6FA-9CAD-30F3-2288-1AC4C85D0A2B]
	// </editor-fold>
	private Car car;

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,id=DCE.6FDA410B-808C-A233-0142-4E593873D540]
	// </editor-fold>
	private int routeNo;

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,id=DCE.74C044E0-9B9A-9962-AB58-E1B9172A17EA]
	// </editor-fold>
	private Date date;

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,id=DCE.16196A52-8F9B-5166-AE1D-4D04D66C7D28]
	// </editor-fold>
	public Schedule ()
	{}

	public void importData(ResultSet data) throws SQLException
	{
		this.setRoute(data.getInt("routeNo"));
		this.setDate(data.getDate("date"));
	}

	public void fetchDependentData(int guardNo, int carNo)
	{
		DBGuard dbg = new DBGuard();
		this.setGuard(dbg.fetchRow("guardNo = "+guardNo, null));
		DBCar dbc = new DBCar();
		dbc.fetchRow("carNo = "+carNo, null);
	}

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,regenBody=yes,id=DCE.8207F008-882D-CF96-94C8-30C59E2CD357]
	// </editor-fold>
	public Car getCar () {
		return car;
	}

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,regenBody=yes,id=DCE.C27B8F98-3A9C-2A1C-A848-B0FDECA9DFFC]
	// </editor-fold>
	public void setCar (Car val) {
		car = val;
	}

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,regenBody=yes,id=DCE.5481B3E1-C49C-4B14-A992-2DC54F0E0AE9]
	// </editor-fold>
	public Date getDate () {
		return date;
	}

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,regenBody=yes,id=DCE.5FDC6FAB-E861-97AA-3BC1-40E73DF75080]
	// </editor-fold>
	public void setDate (Date val) {
		date = val;
	}

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,regenBody=yes,id=DCE.4752B13B-EAE7-ABE2-9F76-639D0B57F890]
	// </editor-fold>
	public Guard getGuard () {
		return guard;
	}

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,regenBody=yes,id=DCE.3C6684AF-D9B8-6F4B-F1EE-CD3C0DD7F1A4]
	// </editor-fold>
	public void setGuard (Guard val) {
		guard = val;
	}

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,regenBody=yes,id=DCE.99D877FF-40A1-D3C5-C3BB-5401E55446DB]
	// </editor-fold>
	public int getRoute () {
		return routeNo;
	}

	// <editor-fold defaultstate="collapsed" desc=" UML Marker ">
	// #[regen=yes,regenBody=yes,id=DCE.6FE3DD08-4B28-E292-739F-65E961F6BF17]
	// </editor-fold>
	public void setRoute (int val) {
		routeNo = val;
	}
}